#define _CRT_SECURE_NO_WANINGS 1
#pragma warning(disable: 4996)
#include<stdio.h>
int add(int c, int d)
{
	printf("%p %p ", &c, &d);
	return d + c;
}
int main()
{
	int a = 1, b = 1;
	int n = add(a, b);
	printf("%p %p \n", &a, &b);
	printf("%d", n);
	return 0;
}
struct ListNode* fast = head, * slow = head;
while (fast && fast->next)
{
    slow = slow->next->next;
    fast = fast->next;
}
struct ListNode* cur = slow;
struct ListNode* prev = nullptr;
while (slow)
{
    cur = cur->next;
    slow->next = prev;
    prev = slow;
    slow = cur;
}
while (head && prev)
{
    if (head->val != prev->val)
    {
        return false;
    }
    head = head->next;
    prev = prev->next;

}
return true;
typedef struct Node Node;
struct Node* copyRandomList(struct Node* head) {
    if (head == NULL)
        return NULL;
    Node* cur = head;
    while (cur)
    {
        Node* copy = (Node*)malloc(sizeof(Node));
        Node* next = cur->next;
        copy->val = cur->val;
        copy->next = next;
        cur->next = copy;
        cur = next;
    }
    cur = head;
    while (cur)
    {
        Node* copy = cur->next;
        if (NULL == cur->random)
        {
            copy->random = NULL;
        }
        else
        {
            copy->random = cur->random->next;
        }
        cur = copy->next;
    }
    cur = head;
    Node* newhead = NULL;
    Node* newtail = NULL;
    while (cur)
    {
        Node* copy = cur->next;
        if (newhead == NULL)
        {
            newhead = newtail = copy;
        }
        else
        {
            newtail->next = copy;
            newtail = newtail->next;
        }
        cur = cur->next->next;
    }
    return newhead;
}